package com.example.easyscript.dto;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

@Setter
@Getter
public class MyPair<T, E> {

    T key;
    E value;

    public MyPair() {
    }

    public MyPair(T t, E e) {
        key = t;
        value = e;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MyPair<?, ?> myPair = (MyPair<?, ?>) o;
        return Objects.equals(key, myPair.key) && Objects.equals(value, myPair.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value);
    }
}
